package hillfly.wifichat.adapter;

import android.app.Fragment;
import android.app.FragmentManager;
//import android.support.v13.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.view.View;

import java.util.List;

import hillfly.wifichat.common.BaseFragment;

public class TabPagerAdapter2 extends PagerAdapter {

	List<BaseFragment> fragments;

	public void SetDate(List<BaseFragment> fragments) {
		this.fragments = fragments;
	}

	public TabPagerAdapter2(FragmentManager fm, List<BaseFragment> fragments) {
//		super(fm);
		this.fragments = fragments;
	}
	@Override
	public Object instantiateItem(View container, int position)
	{
//		((ViewPager)container).addView(fragments.get(position), 0);
		return fragments.get(position);
	}
//	@Override
//	public Fragment getItem(int position) {
//		return fragments.get(position);
//	}
	
	@Override
	public int getCount() {
		return fragments.size();
	}

	@Override
	public boolean isViewFromObject(View view, Object object) {
		return false;
	}
}
